﻿using System;
using System.Collections.Generic;
using System.Text;
using Business;
using Business.Struct;
using System.Data;
using WF_DataAccess;
using WF_Business;

namespace Business.Admin
{
    /// <summary>
    /// 挂起批准类操作
    /// </summary>
    public class GqpzInfo
    {
        /// <summary>
        /// 获取所有流程信息（st_workflow）
        /// </summary>
        /// <returns></returns>
        public static List<SuspendStruct> GetFlowNameInfo()
        {

            string strSql = string.Format("select t.wname,t.wid from st_workflow t where rot = 0 order by t.wname");
            DataTable dtOut;
            SysParams.OAConnection().RunSql(strSql, out dtOut);

            List<SuspendStruct> lstFlowInfo = new List<SuspendStruct>();
            foreach (DataRow drTemp in dtOut.Rows)
            {
                SuspendStruct suspend = new SuspendStruct();
                suspend.Flowname = drTemp["wname"].ToString();
                suspend.Flowno = drTemp["wid"].ToString();
                lstFlowInfo.Add(suspend);
            }
            return lstFlowInfo;
        }
       
        /// <summary>
        /// 获取申请挂起业务信息（未挂起）
        /// </summary>
        /// <returns></returns>
        public DataTable GetAllSenialInfo()
        {
            string strSql = @"select s.serial,a.name, s.handleid,s.suspend_type, s.userid,to_char(apply_time, 'YYYY-MM-DD HH24:MI:SS'), s.memo, id,  b.wname
  from xt_suspend_apply s, st_instance a, st_workflow b where a.wid = b.wid   and a.iid = s.serial and ischeckup is null and isdelete is null";
            DataTable dt = new DataTable();
            SysParams.OAConnection().RunSql(strSql, out dt);
            return dt;
        }

    }
}
